package com.feicheng.controller.shop.admin.store;


import com.alibaba.fastjson.JSONObject;
import com.feicheng.common.constant.Constant;
import com.feicheng.common.result.ResultInfo;
import com.feicheng.service.IFCheckCodeService;
import com.feicheng.service.impl.FStoreServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author cailongyang
 * @since 2021-12-02
 */
@RestController("/shop/admin/access")
@RequestMapping("/shop/admin/store/acc")
@Slf4j
public class AccessController {
    @Autowired
    FStoreServiceImpl fStoreService;

    @Autowired
    IFCheckCodeService ifCheckCodeService;

    @GetMapping("/page")
    public ResultInfo getAccessByPage(Integer accessId,
                                      String modelNumber,
                                      String uId,
                                      String uKey,
                                      String sn,
                                      Boolean statu,
                                      Boolean ioFlg,
                                      Integer current,
                                      Integer size,
                                      Integer storeId){
        JSONObject param=new JSONObject();
        param.put(Constant.ENTITY.ACCESS.ACCESS_ID,accessId);
        param.put(Constant.ENTITY.ACCESS.MODEL_NUMBER,modelNumber);
        param.put(Constant.ENTITY.ACCESS.U_ID,uId);
        param.put(Constant.ENTITY.ACCESS.U_KEY,uKey);
        param.put(Constant.ENTITY.ACCESS.SN,sn);
        param.put(Constant.ENTITY.ACCESS.STATU,statu);
        param.put(Constant.ENTITY.STORE_ACCESS.IO_FLG,ioFlg);
        param.put(Constant.HTTP.PARAM.CURRENT,current);
        param.put(Constant.HTTP.PARAM.SIZE,size);
        param.put(Constant.MODEL_NAME.QCODEVAL.STORE_ID,storeId);
        return fStoreService.getAccessesByPage(param);
    }
}
